using System;
using System.Collections.Generic;
using System.Resources;

namespace needle.Services.astra.Collections
{
	/// <summary>
	/// <see cref="NamedValueKey{T}"/> with <see cref="NamedValueKey{T}.Name"/> stored as field.
	/// </summary>
	/// <typeparam name="T"><see cref="ValueKey{T}.Id"/> type.</typeparam>
	public class SimpleNamedValueKey<T> : NamedValueKey<T>
	{
		/// <summary>
		/// Constructor.
		/// </summary>
		/// <remarks>Calls <see cref="Validate"/>(<paramref name="id"/>).</remarks>
		/// <param name="id">See <see cref="Id"/>.</param>
		/// <param name="name">See <see cref="Name"/>.</param>
		public SimpleNamedValueKey(T id, string name)
			: base(id)
		{
			_name = name;
		}

		/// <summary>
		/// See <see cref="NamedValueKey{T}.Name"/>.
		/// </summary>
		/// <value>
		/// Gets name from <see cref="_name"/> field.
		/// </value>
		public override string Name
		{
			get { return _name; }
		}

		/// <summary>
		/// See <see cref="Name"/>.
		/// </summary>
		private string _name;
	}
}
